/*
 * timers_control.c
 *
 *  Created on: 07.02.2014
 *      Author: Gigi
 */
#include "a_nRF24L01.h"
#include<timers_control.h>




void timers_control_timer0_init(void);



volatile unsigned long milis;







/* initialization of timer 0 to trigger an interrupt every milisecond */
void timers_control_timer0_init(void)
{
	TCCR0A = 1 << WGM01;					// TIMER is now in CTC mode
	TCCR0B = ( 1 << CS01 ) | ( 1 << CS00 );	// 1:64 prescaler
	OCR0A = 249;							// value to have an compare at
	TIMSK0 = 1 << OCIE0A;					// Enable timer interrupts
	sei();									// Enable global interrupts
}

ISR(TIMER0_COMPA_vect)
{
	milis++;
}

